/*
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
*/
#include<stdio.h>

int main(void)
{
	char t,a[1001]="\x00";
	int i=0,j;
	while (1)
	{
		t=getchar();
		if((('a'<=t)&& (t<='z')) || (('A'<=t)&& (t<='Z')))
		{
			a[i++]=t;
		}
		else
		{
			i--;
			while(i>=0)
			{
				printf("%c",a[i]);
				i--;
			}
			i=0;
			printf("%c",t);
			if(t=='\n')
				break;
		}
	}
	return 0;
}
